<?php
$activeSpace = Blyn::app()->getActiveSpace();

//get activeApp
$activeApp = Blyn::app()->getActiveApp();

//current operation
//$currentOperation = Blyn::app()->getActiveOperation();
//get all apps of space
$apps = $activeSpace->getApps();

//get operations from app
$ops = $activeApp->getOperations();

$operationListData = array();
foreach ($apps as $id => $app) {
    if ($app instanceof BApp) {
        $ops = $app->getOperations();
        foreach ($ops as $opId => $operation) {
            if ($operation instanceof BOperation)
                $operationListData[$opId] = $app->getName() . '||' . $operation->getName();
        }
    }
}
?>
<form>
    <fieldset>
        <div class="well">
            <select>
                <?php foreach ($operationListData as $id => $value) { ?>
                    <option value='<?php echo $id; ?>'><?php echo $value; ?></option>               
                <?php } ?>
            </select>
        </div>
        <div><a href="#">add menu</div>      
        <div>
            <div class="row span3"></div>
            <input type="text" placeholder="Type menu name">
            <div class="row span3"><a href="#">Get Url</a></div>
            <div id="generated_url"class="row span6"><?php echo $url; ?></div>
        </div>
    </fieldset>

</form>

